<!-- 角色薪资详情弹窗 -->
<template>
  <a-form
    ref="form3"
    class="ele-form-detail"
    :model="roleSalaryModalApp.roleSalary"
    :label-col="{md: {span: 2}, sm: {span: 4}, xs: {span: 6}}"
    :wrapper-col="{md: {span: 22}, sm: {span: 20}, xs: {span: 18}}">
    <a-descriptions :title="roleSalaryModalApp.title" bordered>
<!--      <a-descriptions-item label="标识">-->
<!--        {{ roleSalaryModalApp.roleSalary.Eid }}-->
<!--      </a-descriptions-item>-->
      <a-descriptions-item label="处理人">
        {{ roleSalaryModalApp.roleSalary.creatorName }}
      </a-descriptions-item>
<!--      <a-descriptions-item label="名称">-->
<!--        {{ roleSalaryModalApp.roleSalary.name }}-->
<!--      </a-descriptions-item>-->
      <a-descriptions-item label="员工角色">
        {{ roleSalaryModalApp.roleSalary.role }}
      </a-descriptions-item>
      <a-descriptions-item label="薪资">
        {{ roleSalaryModalApp.roleSalary.salary }}
      </a-descriptions-item>
<!--      <a-descriptions-item label="状态">-->
<!--        {{ roleSalaryModalApp.roleSalary.status }}-->
<!--      </a-descriptions-item>-->
<!--      <a-descriptions-item label="创建人ID">-->
<!--        {{ roleSalaryModalApp.roleSalary.creatorId }}-->
<!--      </a-descriptions-item>-->
      <a-descriptions-item label="备注">
        {{ roleSalaryModalApp.roleSalary.remark }}
      </a-descriptions-item>
      <a-descriptions-item label="时间">
        {{ roleSalaryModalApp.roleSalary.createDatetime }}
      </a-descriptions-item>
    </a-descriptions>
  </a-form>
</template>

<script>
import {defineComponent, reactive, onMounted, inject} from "vue";
import {useRoute} from "vue-router"
import {RoleSalaryService} from "@/views/restaurant/staff/roleSalary/roleSalaryService";

export default defineComponent({
  setup() {
    const route = useRoute();
    let routeId = route.params.id;
    let roleSalaryListApp = inject('roleSalaryListApp', reactive({}));
    const roleSalaryModalApp = reactive({id: null, roleSalary: {}, display: false});

    onMounted(() => {
      roleSalaryModalApp.roleSalary = {};
      if (routeId) {
        roleSalaryModalApp.id = routeId;
      } else if (roleSalaryListApp.viewModalShowing) {
        roleSalaryModalApp.id = roleSalaryListApp.currentId;
        roleSalaryModalApp.display = true;
      }
      if (roleSalaryModalApp.id) {
        getInfo(roleSalaryModalApp.id);
      }
    })

    const getInfo = (id) => {
      RoleSalaryService.findRoleSalary(id).then((res) => {
        roleSalaryModalApp.roleSalary = res.data;
        roleSalaryModalApp.title = "查看 " + roleSalaryModalApp.roleSalary.name;
      })
    }

    return {
      roleSalaryModalApp,
      routeId,
      getInfo,
    }
  }
})
</script>

<style scoped>
</style>

